package com.chianghao.rock.system.dao.route;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.chianghao.core.mybatis.sql.SqlWrapper;
import com.chianghao.core.mybatis.sql.db_enum.SqlOperators;
import com.chianghao.rock.system.entity.Route;

@Component
public class RouteDao  {

	
	@Autowired
	RouteMapper mapper;
	
	public List<Route> queryAllRoute() {
		Route where  = new Route();
		where.setType(0);
		return this.mapper.queryListByEntity(where, null);
	}


	public List<Route> queryListById(List<Long> routeIds) {
		SqlWrapper sqlWrapper  = new SqlWrapper().addCondition(Route::getId, SqlOperators.in,routeIds.toArray(new Long[routeIds.size()]));
		return this.mapper.queryList(sqlWrapper);
	}
	
}
